using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace LineCountGUI
{
	/// <summary>
	/// Summary description for Options.
	/// </summary>
	public class OptionsForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.TextBox textBoxFiles;
		private System.Windows.Forms.TextBox textBoxDirs;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public OptionsForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.label1 = new System.Windows.Forms.Label();
			this.textBoxFiles = new System.Windows.Forms.TextBox();
			this.textBoxDirs = new System.Windows.Forms.TextBox();
			this.label2 = new System.Windows.Forms.Label();
			this.button1 = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.AutoSize = true;
			this.label1.Location = new System.Drawing.Point(4, 4);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(226, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "File Types (Search Pattern, Separated by \';\')";
			// 
			// textBoxFiles
			// 
			this.textBoxFiles.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.textBoxFiles.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.textBoxFiles.Location = new System.Drawing.Point(12, 24);
			this.textBoxFiles.Name = "textBoxFiles";
			this.textBoxFiles.Size = new System.Drawing.Size(464, 20);
			this.textBoxFiles.TabIndex = 1;
			this.textBoxFiles.Text = "*.cs;*.vb";
			// 
			// textBoxDirs
			// 
			this.textBoxDirs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.textBoxDirs.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.textBoxDirs.Location = new System.Drawing.Point(12, 84);
			this.textBoxDirs.Name = "textBoxDirs";
			this.textBoxDirs.Size = new System.Drawing.Size(464, 20);
			this.textBoxDirs.TabIndex = 3;
			this.textBoxDirs.Text = "bin;obj;.svn";
			// 
			// label2
			// 
			this.label2.AutoSize = true;
			this.label2.Location = new System.Drawing.Point(4, 64);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(250, 16);
			this.label2.TabIndex = 2;
			this.label2.Text = "Ignore Directories (Exact Name, Separated by \';\')";
			// 
			// button1
			// 
			this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.button1.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.button1.Location = new System.Drawing.Point(400, 116);
			this.button1.Name = "button1";
			this.button1.TabIndex = 4;
			this.button1.Text = "Done";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// OptionsForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(488, 146);
			this.Controls.Add(this.button1);
			this.Controls.Add(this.textBoxDirs);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.textBoxFiles);
			this.Controls.Add(this.label1);
			this.Name = "OptionsForm";
			this.Text = "Options";
			this.ResumeLayout(false);

		}
		#endregion

		private void button1_Click(object sender, System.EventArgs e)
		{
			Close();
		}

		public string[] IgnoreDirectories
		{
			get{ return textBoxDirs.Text.Split(';'); }
			set
			{
				string[] dirs = value;
				String text = "";
				foreach( string str in dirs )
				{
					text += str + ";";
				}
				textBoxDirs.Text = text.TrimEnd( ';' );
			}
		}

		public string[] FilePatterns
		{
			get{ return textBoxFiles.Text.Split(';'); }
			set
			{
				string[] patterns = value;
				String text = "";
				foreach( string str in patterns )
				{
					text += str + ";";
				}
				textBoxFiles.Text = text.TrimEnd( ';' );
			}
		}

	}
}
